A message broker performs data exchange that is unrelated to a platform using an efficient and reliable message transfer mechanism, and the message broker is capable of expanding communication between processes in a distributed environment using a message transfer and message queuing model.
Among message transmission modes of the message broker, a publish/subscribe mode is a most commonly used transmission mechanism. Information is exchanged between a publisher and a subscriber using a topic, the publisher publishes a message on a related topic, and the subscriber registers on the topic and receives information in the topic. In this manner, the topic connects the publisher and the subscriber.
A message routing manner of a conventional publish/subscribe system is a routing manner based on a combination of content and an address. In such a routing system, firstly, whether messages about a same topic have or do not have interested subscribers, and destination servers and receiving queues for these subscribers are determined according to topic content and with reference to subscribers collected in advance; then, local receiving queues to which these messages are distributed and a next routing node of these messages are determined using a static routing system. Therefore, in such a routing system, a message transmitted between the publisher and the subscriber must carry a topic.
However, changes of a topic, for example, a change of a topic name or category, all affect a routing destination of a message, and the publisher or the subscriber must know these changes so as to publish or subscribe to a message on a correct topic. In a large-scale application scenario, especially in a situation of an Internet environment, such a change leads to a great change of the publisher or the subscriber and an unnecessary network overhead.